﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SearchCourseAllList.aspx.cs"
    Inherits="CourseListManagement_SearchCourseAllList" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>课程列表</title>
    <link href="../Css/ys.css" rel="stylesheet" type="text/css" />

    <script src="../Js/jquery-1.4.2.min.js" type="text/javascript"></script>

    <script src="../Js/tablehover.js" type="text/javascript"></script>

    <script language="javascript" src="../My97DatePicker/WdatePicker.js"></script>

    <style type="text/css">
        .style1
        {
            width: 132px;
        }
    </style>

    <script>
        //        //CheckBox选择项
        //        function CCA() {

        //            var frm = document.getElementsByTagName("*");
        //            $("allbox").checked = true;
        //            for (var i = 0; i < frm.length; i++) {
        //                var e = frm[i];
        //                if ((e != null) && (e.name == "CKB_Order") && (e.type == 'checkbox') && (!e.checked)) {
        //                    $("allbox").checked = false;
        //                }
        //            }

        //        }


        //        //----------------------------------------------------------------------
        //        function CA() {
        //           

        //            //CheckBox全选
        //            var frm = document.getElementsByTagName("*");
        //            if (frm) {
        //                for (var i = 0; i < frm.length; i++) {
        //                    var e = frm[i];

        //                    if ((e != null) && (e.type == 'checkbox')) {
        //                    
        //                        e.checked = $("allbox").checked;
        //                    } //endif
        //                } //endfor
        //            }
        //            return false;

        //        }

        var f = false;
        function ChkSelect() {
            var check = "";
            var code_Values = document.getElementsByTagName("input");
            for (i = 0; i < code_Values.length; i++) {
                if (code_Values[i].checked == true) {
                    check += code_Values[i].value + ',';
                    f = true;
                }
            }
            if (!f) {
                alert("对不起请选择数据再删除！");
                return false;
            }
            $("#hfCheckItem").val(check);
        }

        function CheckAll() {
            var code_Values = document.getElementsByTagName("input");
            for (i = 0; i < code_Values.length; i++) {
                if (code_Values[i].type == "checkbox") {
                    code_Values[i].checked = true;
                }
            }

        }
        function uncheckAll() {
            var code_Values = document.getElementsByTagName("input");
            for (i = 0; i < code_Values.length; i++) {
                if (code_Values[i].type == "checkbox") {
                    code_Values[i].checked = false;
                }
            }
        } 

    </script>

</head>
<body>
    <form id="form1" runat="server">
    <input type="hidden" id="hfClick" />
    <div style="margin-left: 5px">
        <div class="title">
            <div class="titleLeft">
                查看课程表信息</div>
        </div>
        <div id="search" class="search">
            <table cellspacing="1" cellpadding="3" border="0" >
                <tr>
                    <td class="noWrapTD">
                        选择课程
                    </td>
                    <td colspan="4" >
                        <div class="taSearch" >
                            <%=courselisthtml%>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <div id="search" class="search">
            <table cellspacing="1" cellpadding="3" border="0">
                <tr>
                    <td class="noWrapTD">
                        上课日期
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtBeginDate" onfocus="new WdatePicker({dateFmt:('yyyy-MM-dd')})"
                            CssClass="inp1 Wdate"></asp:TextBox>&nbsp;<asp:Label ID="lblStarDate" runat="server"
                                ForeColor="Red"></asp:Label>至
                    </td>
                    <td class="style1">
                        <asp:TextBox runat="server" ID="txtendDate" onfocus="new WdatePicker({dateFmt:('yyyy-MM-dd')})"
                            CssClass="inp1 Wdate"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Button runat="server" CssClass="button" ID="btnSearch" Text="查找" OnClick="btnSearch_Click"
                            Width="60px" />
                    </td>
                    <td>
                        <asp:Button ID="btnAddCourseList" runat="server" Text="添加课程表" CssClass="button" OnClick="btnAddCourseList_Click" />&nbsp;<asp:Button
                            ID="btnQuantityCourseList" runat="server" Text="批量录入课程表" CssClass="button" OnClick="btnQuantityCourseList_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <br class="sp3px" />
        <table class="tab_alt" style="width: 100%" cellpadding="0" cellspacing="0">
            <tr class="header">
                <td>
                    <a href="javascript:" onclick="CheckAll();"><span class="noWrapTD">全选</span></a>
                    /<a href="javascript:" onclick="uncheckAll();"><span class="noWrapTD">取消</span></a>&nbsp;<a
                        href="javascript:"><span class="noWrapTD"><asp:LinkButton ID="lnkDel" runat="server"
                            OnClientClick="return ChkSelect();" OnClick="lnkDel_Click">删除</asp:LinkButton>
                        </span></a>
                </td>
                <td class="noWrapTD">
                    操作
                </td>
                <%--<td class="noWrapTD" >序号</td>--%>
                <td class="noWrapTD">
                    培训班
                </td>
                <td class="noWrapTD">
                    培训班编号
                </td>
                <td class="noWrapTD">
                    教室名称
                </td>
                <td class="noWrapTD">
                    课程名称
                </td>
                <td class="noWrapTD">
                    教师名称
                </td>
                <td class="noWrapTD">
                    上课日期
                </td>
                <td class="noWrapTD">
                    上课结束日期
                </td>
                <td class="noWrapTD">
                    上课开始时间
                </td>
                <td class="noWrapTD">
                    上课结束时间
                </td>
            </tr>
            <input type="hidden" runat="server" id="hfCheckItem" />
            <asp:Repeater ID="repAllCourseList" runat="server">
                <ItemTemplate>
                    <tr class="<%# Container.ItemIndex%2==1?"odd":"" %>">
                        <td>
                            <input type="checkbox" id="C_<%#Eval("ID") %>" name="CKB_Order" value="<%#Eval("ID") %>" />
                        </td>
                        <td class="ta2">
                            <asp:LinkButton CssClass="button2" ID="lbdelete" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"ID") %>'
                                OnCommand="lbdelete_Command" OnClientClick='return confirm("确定要删除么？")' Text="删除"></asp:LinkButton>&nbsp;<asp:LinkButton
                                    CssClass="button2" ID="lbUpdate" runat="server" CommandArgument='<%#Eval("ID")%>'
                                    OnCommand="lbUpdate_Click" Text="修改"></asp:LinkButton>
                        </td>
                        <%--<td class="noWrapTD"><%#Eval("ID") %></td>--%>
                        <td class="ta2" align="center">
                            <%#Eval("VTC_name")%>
                        </td>
                        <td class="ta2" align="center">
                            <%#Eval("VTC_Number")%>
                        </td>
                        <td class="ta2" align="center">
                            <%#Eval("vr_roomname") %>
                        </td>
                        <td class="ta2" align="center">
                            <%#Eval("vc_name") %>
                        </td>
                        <td class="ta2" align="center">
                            <%#Eval("vt_realname") %>
                        </td>
                        <td class="ta2" align="center">
                            <%#DataBinder.Eval(Container.DataItem,"vcl_startdate","{0:yyyy-MM-dd}")%>
                        </td>
                        <td class="ta2" align="center">
                            <%#DataBinder.Eval(Container.DataItem,"vcl_enddate","{0:yyyy-MM-dd}")%>
                        </td>
                        <td class="ta2" align="center">
                            <%#DataBinder.Eval(Container.DataItem, "vcl_starttime","{0:hh:mm}")%>
                        </td>
                        <td class="ta2" align="center">
                            <%#DataBinder.Eval(Container.DataItem, "vcl_endtime", "{0:hh:mm}")%>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
        </table>
        <br class="sp3px" />
        <webdiyer:AspNetPager ID="pager" runat="server" OnPageChanged="pager_PageChanged"
            CssClass="anpager" CurrentPageButtonClass="cpb" PageSize="30">
        </webdiyer:AspNetPager>
    </div>
    </form>
</body>
</html>
